package modelo;


public class Misas{
	private MisasValues current;
	private MisasValues[] values;
	private int misaInterval;
	
	
	public Misas(int misaInterval){
		values = MisasValues.values();
		current = values[0];
		this.misaInterval = misaInterval;
	}
	
	public void setNext(){
		Game.getInstance().exchangeSuspectsCardsMisa(getNumberOfCards());
		current = values[current.ordinal()+1 % values.length];
	}
	
	public String toString(){
		return current.toString();
	}
	
	public int getNumberOfCards(){
		return current.getNumberOfCards();
	}
	
	public int getMisaInterval(){
		return misaInterval;
	}
	
	public int getMisaCardNumber() {
		return current.misaCard;
	}

	private enum MisasValues {
		MAITINES(0), LAUDES(1), PRIMA(2), TERCIA(3), SEXTA(4), NONA(5), VISPERAS(6), COMPLETAS(7);

		private int misaCard;

		private MisasValues(int misaCard){
			this.misaCard = misaCard;
		}

		private int getNumberOfCards() {
			
			int numberOfCards = 0;
			
			switch(this) {
			case COMPLETAS:
				numberOfCards = 6;
				break;
			case LAUDES:
				numberOfCards = 1;
				break;
			case MAITINES:
				numberOfCards = 1;
				break;
			case NONA:
				numberOfCards = 6;
				break;
			case PRIMA:
				numberOfCards = 3;
				break;
			case SEXTA:
				numberOfCards = 5;
				break;
			case TERCIA:
				numberOfCards = 4;
				break;
			case VISPERAS:
				numberOfCards = 6;
				break;
			default:
				break;
			}
			return numberOfCards;
		}
	}
}